package com.xuzimian.springboot.scaffolding.httphandler;

import com.xuzimian.springboot.scaffolding.model.Speaker;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Service
public class HomeHandler {


    public Mono<ServerResponse> getSpeaker(ServerRequest request) {
        return ServerResponse.ok().body(Mono.just(new Speaker()), Speaker.class);
    }

    @GetMapping("/SpeakerName/{id}")
    public Mono<ServerResponse> getSpeakerName(ServerRequest request) {
        return ServerResponse.ok().body(Mono.just(new Speaker()), Speaker.class);
    }

}

